package com.zhaoshixin.rabbit.controller;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RabbitController {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @RequestMapping("send")
    public String send(){
        rabbitTemplate.convertAndSend("bizExchange","","aaaaaa!!!!");
        return "发送成功!!";
    }
    @RequestMapping("hello")
    public String hello(){
        return "hello!!";
    }
}